import { fromJS } from 'immutable';
import * as constants from './constants';
import Utils from '../../../common/utils'

const defaultState = fromJS({
	avatar: '',
	work: {},
	order: [],
	menuInfo: {
		menu: 'info',
		title: '修改资料'
	}
});

export default (state = defaultState, action) => {
	switch(action.type) {
		// case constants.CHANGE_AVATAR:
		// 	return state.set('avatar', action.value);
		case constants.CHANGE_WORK:
			return state.set('work', action.value);
		case constants.CHANGE_ORDER:
			return state.set('order', action.value);
		case constants.CHANGE_MENU:
			return state.set('menuInfo', action.value);
		default:
			return state;
	}
}